/**
 * 
 */
package com.yidin.lsc;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.GridView;
import android.widget.TextView;

/**
 * 会员卡
 * @author cola
 *
 */
public class VIPCard extends Container{
	protected Button rightBtn;
	protected Button leftBtn;
	private VIPCardAdapter myAdapter;
	protected ViewGroup ViewContainer;
	private GridView myGridView;
	protected List<VIPCardList> netInfos = null;
	
	public VIPCard(Activity activity, View contentView, Views father) {
		super(activity, contentView, father);
		// TODO Auto-generated constructor stub
		initialize();
	}

	@Override
	public void checkCache() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void findView(View contentView) {
		// TODO Auto-generated method stub
		View view = null;
		view = inflater.inflate(R.layout.gridview, null);

		ViewContainer.addView(view);
		((TextView) contentView.findViewById(R.id.title)).setText("会员卡");
		this.rightBtn = (Button) contentView.findViewById(R.id.list);
		this.leftBtn = (Button) contentView.findViewById(R.id.speedDial);
		this.myGridView = (GridView) contentView.findViewById(R.id.blog);
		this.myGridView.setVisibility(View.VISIBLE);
	}

	@Override
	public void showFunctionsListView(View contentView) {
		// TODO Auto-generated method stub
		ViewContainer = (ViewGroup) contentView
				.findViewById(R.id.ViewContainer);
	}

	@Override
	public void initialize() {
		// TODO Auto-generated method stub
		netInfos = new ArrayList<VIPCardList>();
		VIPCardList a  = new VIPCardList();
		a.name = "";
		a.imageUrl = "http://avatar.csdn.net/blogpic/20111027153722438.jpg";
		netInfos.add(a);
		
		VIPCardList a2  = new VIPCardList();
		a2.name = "";
		a2.imageUrl = "http://avatar.csdn.net/blogpic/20111027153722438.jpg";
		netInfos.add(a2);
		
		this.myAdapter = new VIPCardAdapter(activity,netInfos);
		this.myGridView.setAdapter(myAdapter);
	}

	@Override
	public void removeView() {
		// TODO Auto-generated method stub
		ViewContainer.removeAllViews();
	}

	@Override
	public void refresh(Object... param) {
		// TODO Auto-generated method stub
		
	}
	
	public class VIPCardList{
		public String name;
		public String imageUrl;
	}
}
